import { DataTypes } from "sequelize";
import sequelize from "./db";

export default sequelize.define('test_paper', {
  "class_id": {
    type: DataTypes.UUID,
    allowNull: true,
  },

  'id': {
    type: DataTypes.UUID,
    allowNull: false,
    unique: true,
    defaultValue: DataTypes.UUIDV4,
    primaryKey: true,
  },

  'title': {
    type: DataTypes.STRING(10),
    allowNull: false,
  },

  'desc': {
    type: DataTypes.STRING(255),
    allowNull: false,
  },

  'start_time': {
    type: DataTypes.STRING(40),
    allowNull: true,
  },

  'exam_time_long': {
    type: DataTypes.INTEGER,
    allowNull: false,
  },

  'stop_time': {
    type: DataTypes.STRING(40),
    allowNull: false,
  },

  'questions': {
    type: DataTypes.STRING(255),
    allowNull: false,
  }

}, {
  createdAt: false,
  updatedAt: false,
  freezeTableName: true
})